<%--
  Created by IntelliJ IDEA.
  User: 27236
  Date: 2021/8/18
  Time: 17:15
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <title>主页</title>
    <link href="${pageContext.request.contextPath}/static/css/bootstrap.min.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath}/static/js/jquery-3.6.0.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/bootstrap.min.js"></script>


</head>
<body>
<div class="container" >
    <div style="float: right;margin: 5px">
        <a class="btn btn-primary" href="${pageContext.request.contextPath}/Teacher/autoExam">自动出卷</a>
    </div>
    <form action="${pageContext.request.contextPath}/Examine/add" method="post">
        <security:csrfInput/>
        <div class="col-lg-4">
            <label for="analyze">试卷介绍</label>
            <input type="text" class="form-control" id="analyze" name="analyze" placeholder="请输入试卷介绍">
        </div>
        <div class="col-lg-4">
            <label for="score">设置总分</label>
            <input type="text" class="form-control" id="score" name="score" placeholder="请输入试卷总分">
        </div>
    <table class="table">
        <tr class="success">
            <th>编号</th>
            <th>题目</th>
            <th>题型</th>

        </tr>
        <c:forEach items="${Question}" var="question" varStatus="s">

                <c:if test="${question.key=='choiceList'}">
                    <c:forEach items="${question.value}" var="q">
                    <tr>
                        <th>${q.id}</th>
                        <th> <input type="checkbox" value="${q.id}" name="choice">${q.title}</th>
                        <th>选择题</th>
                    </tr>
                    </c:forEach>
                </c:if>
            <c:if test="${question.key=='fillList'}">
                <c:forEach items="${question.value}" var="q">
                    <tr>
                        <th>${q.id}</th>
                        <th> <input type="checkbox" value="${q.id}" name="fill">${q.title}</th>
                        <th>填空题</th>
                    </tr>
                </c:forEach>
            </c:if>
            <c:if test="${question.key=='shortAnswerList'}">
                <c:forEach items="${question.value}" var="q">
                    <tr>
                        <th>${q.id}</th>
                        <th> <input type="checkbox" value="${q.id}" name="shortAnswer">${q.title}</th>
                        <th>简答题</th>
                    </tr>
                </c:forEach>
            </c:if>
        </c:forEach>
    </table>
        <div align="center">
            <input class="btn btn-default" type="submit" value="添加" />
        </div>
    </form>
</div>
</body>
</html>
